package com.econ.powercloud.ems.controller;

import com.econ.powercloud.common.base.facade.pojo.MsgResult;
import com.econ.powercloud.ems.pojo.AreaTimeSectionVO;
import com.econ.powercloud.ems.service.biz.AreaTimeSectionBizService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ Description:尖峰平谷时间段
 * @ Author：hgp
 * @ Create:2023-02-16-9:03
 */
@Api(tags = "尖峰平谷时间段")
@RestController
@RequestMapping(value = "/api/v2/time/section")
public class AreaTimeSectionController extends ApiBaseController{
    @Autowired
    private AreaTimeSectionBizService areaTimeSectionBizService;

    /**
     * 根基时间戳以及储能站ID查询储能站所在地区的所查询日期的尖峰平谷时间段数据
     * @param time      查询日期的时间戳
     * @param stationId 储能站ID
     * @return
     */
    @ApiOperation(value = "获取储能站尖峰平谷时间段")
    @ApiImplicitParams({
            @ApiImplicitParam(paramType = "query", name = "time", value = "要查询的日期的时间戳", required = true, dataType = "Long"),
            @ApiImplicitParam(paramType = "query", name = "stationId", value = "储能站ID", dataType = "String"),
    })
    @GetMapping
    public MsgResult<AreaTimeSectionVO> get(@RequestParam Long time,
                                            @RequestParam(required = false) String stationId) {
        return this.successHandler(areaTimeSectionBizService.get(time, stationId));
    }


}
